package com.sskj.fabi.presenter;

import com.lzy.okrx2.adapter.FlowableBody;
import com.sskj.common.base.HttpData;
import com.sskj.fabi.bean.OrderRecordBean;
import com.sskj.fabi.ui.fragment.FabiRecordFragment;
import com.sskj.lib.bean.PageBean;
import com.sskj.lib.http.JsonConverter;

import java.util.List;

import io.reactivex.Flowable;


public class FabiRecordFragmentPresenter extends BasePresenter<FabiRecordFragment> {
    public Flowable<List<OrderRecordBean>> getData(String page, String pageSize,String status,String tradeType) {
       return httpService.getOrderRecord(page,pageSize,status,tradeType)

                .converter(new JsonConverter<HttpData<PageBean<OrderRecordBean>>>() {
                })
                .adapt(new FlowableBody<>())
                .map(haiPageBeanHttpData -> haiPageBeanHttpData.getData().getList())
               ;
    }
}
